// const obj: { name: string; age: number; register(): void } = {
//   name: '张三',
//   age: 18,
//   register() {
//     console.log(`注册用户：${this.name}`);
//   }
// }

const obj: { 
  name: string
  age: number
  // register(): void 
  register: () => void 
} = {
  name: '张三',
  age: 18,
  register() {
    console.log(`注册用户：${this.name}`);
  }
}